package com.bwie.parkdemo.adapter;

import android.graphics.Color;
import android.support.annotation.NonNull;
import android.widget.TextView;

import com.bwie.parkdemo.R;
import com.bwie.parkdemo.mvvm.model.entity.RepairUserEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

/**
 * 横向维修人员列表适配器
 * */
public class RepairUserAdapter extends BaseQuickAdapter<Object,BaseViewHolder>{

    public static final int TYPE = 7;

    public RepairUserAdapter() {
        super(R.layout.item_repair_user);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, Object item) {
        RepairUserEntity.Values entity = (RepairUserEntity.Values) item;
        TextView tv = helper.getView(R.id.repair_user_tv);
        tv.setText(entity.uName);
        tv.setBackgroundColor(Color.parseColor("#c1c1c1"));
        tv.setTextColor(Color.parseColor("#101010"));
        if (entity.isSel){
            tv.setBackgroundColor(Color.parseColor("#03AAF4"));
            tv.setTextColor(Color.parseColor("#ffffff"));
        }
    }
}
